package core.service.impl;

import core.dao.StudentAndClassDao;
import core.pojo.StudentClass;
import core.pojo.StudentTemp;
import core.service.StudentAndClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;

@Service
@Transactional
public class StudentAndClassServiceImpl implements StudentAndClassService {

    @Autowired
    private StudentAndClassDao studentAndClassDao;

    @Override
    public StudentTemp getStudentAndClass(int id) {
        StudentTemp st = studentAndClassDao.getStudentAndClass(id);
        return st;
    }

    @Override
    public StudentClass getStudentAndClassView(int id) {
        StudentClass sc = studentAndClassDao.getStudentAndClassView(id);
        return sc;
    }

    @Override
    public StudentTemp getClassStudents(@PathVariable int id){

        return   studentAndClassDao.getStudentAndClass(id);

    }

    @Override
    public void deleteClassStudent(int id) {
        studentAndClassDao.deleteClassStudent(id);
    }
}
